﻿using MessageQuque.Common;
using MessageQuque.Common.Base.Model;
using MessageQuque.Server;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace MessageQuque
{
    class Program
    {
        // 缓存实例化对象
        private static IDictionary<string, IReceiver> receiverList;
        static Program()
        {
            receiverList = ServerExecutor.GetReceives();
        }
        static void Main(string[] args)
        {
            //具体实现功能的方法
            foreach (var item in receiverList)
            {
                try
                {
                    var service = item.Value;
                    service.Dequeue();
                }
                catch (Exception ee)
                {
                    Logger.Error(ee.Message, ee);
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine(ee.Message);
                    Console.ReadLine();
                }
            }
        }
    }
}
